package pers.lx.crm.base.util;

import pers.lx.crm.entiy.BaseDO;

/**
 * Created by lxl on 2017/2/14.
 */
public final class StringUtil {

    public final static String getCountSql(String sql){
        return "select count(*) from (" + sql + ") as list" ;
    }

    public final static String getPageSql(BaseDO page,String sql){
        int offset = ( page.getPageNum() - 1 ) * page.getPageSize() ;
        return  sql+ " limit " + offset + "," + page.getPageSize();
    }

}
